$(document).ready(function () {
    $("#adminlogin").click(function () {
        let account = $("#Account").val();
        let password = $("#password").val();
        getValue(account,password);
    })
})

function getValue(account,password)
{
    let url = "users?method=Login&id=" + account + "&pwd=" + password;
    $.get(url, function (data, status) {
        let errcode = data["errcode"];
        let errmsg = data["errmsg"];
        switch (errcode) {
            case 1://管理员
                window.location.href="sjcx.html";
                break;
            case 2://用户
                window.location.href="tbzs.html";
                break;
            default:
                alert(errmsg);
                break;
        }
    })
}